
import java.util.ArrayList;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author RAUL
 */
public class MiStack <E> implements Stack <E> {

    // Atributos 
    ArrayList<E> lista = new ArrayList<E> (); 
    private E valor;
    private int tamano;
    private int index = 0;
    private boolean vacio; 
    
    
    @Override
    public void push(E item) {
        lista.add(item) ; 
        index += 1; 
    }

    @Override
    public E pop() {
        if(vacio = true){
            System.out.println("El stack esta vacio");
            
        }
        index -=1; 
        valor = lista.get(index);  
        
        return valor;
    }

    @Override
    public E peek() {
       return  
    }

    @Override
    public boolean empty() {
        if (index == 0)
            vacio = true;
        else
            vacio = false;
                
        
        return vacio; 
    }

    

   

    

   

    
    
}
